
import 'package:fluro/fluro.dart';
import 'package:flutter/cupertino.dart';

class HBRouter{

  static FluroRouter router;

  static Future navigateTo(BuildContext context, String path, {Map params,bool clearStack = false, TransitionType transitionType = TransitionType.cupertino}){
    String query = "";
    if (params !=null){
      int index = 0;
      params.forEach((key,value) {
        print(index);
        var value = Uri.encodeComponent(params[key].toString());
        if(index==0){
          query = "?";
        }else{
          query += "\&";
        }
        query += "$key=$value";
        index++;
      });
    }
    path += query;
    return router.navigateTo(context, path,transition: transitionType,clearStack: clearStack);
  }


}